import 'package:flutter_ohos/generated/json/base/json_convert_content.dart';
import 'package:flutter_ohos/app/modules/fourth/model/fourth_data_entity.dart';

FourthDataEntity $FourthDataEntityFromJson(Map<String, dynamic> json) {
  final FourthDataEntity fourthDataEntity = FourthDataEntity();
  final String? name = jsonConvert.convert<String>(json['name']);
  if (name != null) {
    fourthDataEntity.name = name;
  }
  final String? gender = jsonConvert.convert<String>(json['gender']);
  if (gender != null) {
    fourthDataEntity.gender = gender;
  }
  final int? age = jsonConvert.convert<int>(json['age']);
  if (age != null) {
    fourthDataEntity.age = age;
  }
  return fourthDataEntity;
}

Map<String, dynamic> $FourthDataEntityToJson(FourthDataEntity entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['name'] = entity.name;
  data['gender'] = entity.gender;
  data['age'] = entity.age;
  return data;
}

extension FourthDataEntityExtension on FourthDataEntity {
  FourthDataEntity copyWith({
    String? name,
    String? gender,
    int? age,
  }) {
    return FourthDataEntity()
      ..name = name ?? this.name
      ..gender = gender ?? this.gender
      ..age = age ?? this.age;
  }
}